classdef solv
    properties
        file
        snapshot_prefix
    end
    
    methods
        function o = solv(net, solv, cmd)
            % See Also:
            %   VDSR.solver.prototxt
            solv.net = net.file;
            solv.snapshot_prefix = fullfile(net.model_path, net.name);
            
            o.file = fullfile(net.result_path, 'solver.prototxt');
            o.snapshot_prefix = solv.snapshot_prefix;
            
            %% update some solver params
            if ~isempty(strfind(lower(cmd.solver_mode), 'gpu'))
                solv.solver_mode = 'GPU';
            else
                solv.solver_mode = 'CPU';
            end
            
            %% create solver file
            o.genFile(solv);
        end
    end
    
    methods(Static)
        solverfile2matparam(solverfile)
    end
end

